package com.tj.collection.controller.lending.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.StringUtils;
import com.fqgj.exception.common.ApplicationException;

/**
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2020/3/17
 * Time: 下午4:02
 */
public class RecordingUploadRequest extends ParamsObject {

    /**
     * 订单号
     */
    private String tradeNo;
    /**
     * 催收单号
     */
    private String collectionNo;
    /**
     * 手机号
     */
    private String mobile;

    /**
     * 拨号时间
     */
    private String startTime;

    /**
     * 结束时间
     */
    private String endTime;

    /**
     * 通话时长(秒)
     */
    private Integer callDuration;
    /**
     * 录音文件链接
     */
    private String url;

    public String getTradeNo() {
        return tradeNo;
    }

    public RecordingUploadRequest setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
        return this;
    }

    public String getCollectionNo() {
        return collectionNo;
    }

    public RecordingUploadRequest setCollectionNo(String collectionNo) {
        this.collectionNo = collectionNo;
        return this;
    }

    public String getMobile() {
        return mobile;
    }

    public RecordingUploadRequest setMobile(String mobile) {
        this.mobile = mobile;
        return this;
    }

    public String getStartTime() {
        return startTime;
    }

    public RecordingUploadRequest setStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    public String getEndTime() {
        return endTime;
    }

    public RecordingUploadRequest setEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

    public Integer getCallDuration() {
        return callDuration;
    }

    public RecordingUploadRequest setCallDuration(Integer callDuration) {
        this.callDuration = callDuration;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public RecordingUploadRequest setUrl(String url) {
        this.url = url;
        return this;
    }

    @Override
    public void validate() {
        if (StringUtils.isEmpty(collectionNo)) {
            throw new ApplicationException("collectionNo is empty");
        }
        if (StringUtils.isEmpty(mobile)) {
            throw new ApplicationException("phone is empty");
        }
    }
}
